package com.yaoq.observer.improve;

/**
 * @ClassName CurrentConditions
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/9/3 15:59
 * @Version 1.0
 */
public class CurrentConditions implements Observer {
    private float temperature;
    private float pressure;
    private float humidity;

    //更新天气情况，是由 WeatherData来调用，我使用推送模式；
    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    private void display() {
        System.out.println("***********temperature:" + temperature);
        System.out.println("***********pressure:" + pressure);
        System.out.println("***********humidity:" + humidity);
    }
}
